<?php
    class Default_Model_Search extends Zend_Db_Table_Abstract
    {
        protected $_db;
        
        public function __construct()
        {
            $this->_db = Zend_Registry::get('db');
        }
        
        public function search($keyword, $table)
        {
            $data = array(
                'id',
                'name',
                'thumbnail',
                'price',
                'sale_price',
                'create_date',
                'url',
                'type',
            );
            $sql = $this->_db->select()
                            ->from($table, $data)
                            ->where('status = 1')
                            ->where('url LIKE ?', $keyword)
                            ->order('id DESC');
            $result = $this->_db->fetchAll($sql);
            return $result;
        }
    }
